package com.wx.serviceImpl;

import java.util.List;

import com.wx.daoImpl.BookDaoImpl;


import com.wx.model.BookType;

import com.wx.model.Books;
import com.wx.service.BookService;

public class BookServiceImpl implements BookService {

	@Override
	public List<BookType> queryAlltype() throws Exception {
		return new BookDaoImpl().queryAll();
	}

	@Override

	public Books bookMsg(int bookid,String username) throws Exception {
		return new BookDaoImpl().bookMsg(bookid,username);
	}

	public boolean addBook(Books book) throws Exception {
		
		return new BookDaoImpl().addBook(book);

	}

	@Override
	public List<Books> querybook(int pageNum , int pageSize) throws Exception {
		
		return new BookDaoImpl().selectBooks(pageNum,pageSize);
	}

	@Override
	public int queryBookSum() throws Exception {
		return new BookDaoImpl().findCount();
	}

	@Override
	public List<Books> queryBookById(int pageNum, int pageSize, int typeid) throws Exception {
		return new BookDaoImpl().selectBooks(pageNum, pageSize, typeid);
	}

	@Override
	public int queryBookSumById(int typeid) throws Exception {
		return new BookDaoImpl().findCount(typeid);
	}

	@Override
	public boolean addBookType(String typename) throws Exception {
		
		return new BookDaoImpl().addBookType(typename);
	}

}
